﻿using System;
using System.Collections.Generic;
using Microsoft.Xna.Framework;
using Microsoft.Xna.Framework.Graphics;
using TLib.Xna;

namespace COMP477_Scorchery
{
    class FireParticle3D : Particle3D
    {
        bool fadeIn;

        public FireParticle3D(Texture2D texture)
            : base(texture)
        {
            Alpha = 0;
            fadeIn = true;
        }

        public override void Init()
        {
            base.Init();
            Alpha = 0;
            fadeIn = true;
        }

        public override void Update(GameTime gameTime, GameObject camera)
        {
            if (fadeIn)
            {
                Alpha = (1 - ((LifeSpan - Age) / LifeSpan)) * 5;
                if (Alpha >= 1)
                    fadeIn = false;
            }
            else
                Alpha = ((LifeSpan - Age) / LifeSpan);

            base.Update(gameTime, camera);
        }
    }
}
